/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entidades;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author dvasquez
 */
@Entity
@Table(name = "nroMoldes")
@NamedQueries({@NamedQuery(name = "NroMoldes.findAll", query = "SELECT n FROM NroMoldes n"), @NamedQuery(name = "NroMoldes.findByNroMolde", query = "SELECT n FROM NroMoldes n WHERE n.nroMoldesPK.nroMolde = :nroMolde"), @NamedQuery(name = "NroMoldes.findById", query = "SELECT n FROM NroMoldes n WHERE n.nroMoldesPK.id = :id")})
public class NroMoldes implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected NroMoldesPK nroMoldesPK;

    public NroMoldes() {
    }

    public NroMoldes(NroMoldesPK nroMoldesPK) {
        this.nroMoldesPK = nroMoldesPK;
    }

    public NroMoldes(int nroMolde, int id) {
        this.nroMoldesPK = new NroMoldesPK(nroMolde, id);
    }

    public NroMoldesPK getNroMoldesPK() {
        return nroMoldesPK;
    }

    public void setNroMoldesPK(NroMoldesPK nroMoldesPK) {
        this.nroMoldesPK = nroMoldesPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nroMoldesPK != null ? nroMoldesPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NroMoldes)) {
            return false;
        }
        NroMoldes other = (NroMoldes) object;
        if ((this.nroMoldesPK == null && other.nroMoldesPK != null) || (this.nroMoldesPK != null && !this.nroMoldesPK.equals(other.nroMoldesPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return nroMoldesPK.toString();
    }

}
